﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
using System.Data;

namespace DataAccess
{
    public class AccountData
    {
        public DataTable login(string userName,string psw)
        {
            DataTable dt = new DataTable();
            Database database = DatabaseFactory.CreateDatabase();
            string sqlCommand = "Login";
            DbCommand dbCommand = database.GetStoredProcCommand(sqlCommand);
            database.AddOutParameter(dbCommand, "@AffectRows", DbType.Int32, 10);
            database.AddInParameter(dbCommand, "@userName", DbType.AnsiString, userName);            
            database.AddInParameter(dbCommand, "@psw", DbType.AnsiString, psw);            
            dt = database.ExecuteDataSet(dbCommand).Tables[0];
            return dt;  
        }
    }
}
